<html xmlns='http://www.w3.org/1999/xhtml'
      xmlns:p='http://primefaces.org/ui'
      xmlns:f='http://java.sun.com/jsf/core'
      xmlns:h='http://java.sun.com/jsf/html'
      xmlns:cc='http://java.sun.com/jsf/composite' style='color: inherit'>

<cc:interface>

<cc:attribute name='id'/>

<cc:attribute name='b'/>

<cc:attribute name='t'/>

<cc:attribute name='v'/>

<cc:attribute name='x'       default='s'/>

<cc:attribute name='wT'      default='65'/>

<cc:attribute name='w'       default='250px'/>

<cc:attribute name='maxL'    default='10'/>

<cc:attribute name='read'    default='#{cc.attrs.b.isRead}'/>

<cc:attribute name='pattern' default='dd.MM.yyyy'/>

<cc:attribute name='onkeydown'/>

<cc:attribute name='onkeypress'/>

<cc:attribute name='sT'/>

<cc:attribute name='style'/>

<cc:attribute name='rendered'/>

<cc:attribute name='sel' method-signature='void listener()'/>

<cc:attribute name='u' default='@(.#{cc.attrs.b.name})'/>

<cc:attribute name='p' default='@(.#{cc.attrs.b.name})'/>

</cc:interface>


<cc:implementation>

<h:panelGrid columns='2' cellpadding='0' cellspacing='0' styleClass='align-text-bottom' style='#{cc.attrs.style}' rendered='#{cc.attrs.rendered}'>

  <h:panelGrid columns='1' cellpadding='0' cellspacing='1' width='#{cc.attrs.wT}' styleClass="#{cc.attrs.read? '':'ui-state-default xFd'}"><span title='#{cc.attrs.maxL}' style='#{cc.attrs.sT}'>#{cc.attrs.t}</span></h:panelGrid>


  <h:panelGroup id='inputDate'>

  <p:calendar   value='#{cc.attrs.v}' rendered="#{!cc.attrs.read and cc.attrs.x =='s'}" navigator='true' pattern='#{cc.attrs.pattern}' style='width: #{cc.attrs.w}' styleClass='xAuto' maxlength='#{cc.attrs.maxL}' onkeydown='#{cc.attrs.onkeydown}' onkeypress='#{cc.attrs.onkeypress}' locale='bo'>

  <p:ajax event='dateSelect' listener='#{cc.attrs.sel}' update='#{cc.attrs.u}' process='#{cc.attrs.p}' partialSubmit='true' disabled='#{cc.attrs.sel==null}'/></p:calendar>

  <h:outputText value='#{cc.attrs.v}' rendered="#{ cc.attrs.read and cc.attrs.x =='s'}" style='width: #{cc.attrs.w}; font-weight: bold'><f:convertDateTime pattern='#{cc.attrs.pattern}'/></h:outputText>


  <p:calendar   value='#{cc.attrs.v}' rendered="#{!cc.attrs.read and cc.attrs.x =='t'}" navigator='true' pattern='#{cc.attrs.pattern} HH:mm' style='width: #{cc.attrs.w}' styleClass='xAuto' maxlength='#{cc.attrs.maxL}' onkeydown='#{cc.attrs.onkeydown}' onkeypress='#{cc.attrs.onkeypress}' locale='bo'>

  <p:ajax event='dateSelect' listener='#{cc.attrs.sel}' update='#{cc.attrs.u}' process='#{cc.attrs.p}' partialSubmit='true' disabled='#{cc.attrs.sel==null}'/></p:calendar>

  <h:outputText value='#{cc.attrs.v}' rendered="#{ cc.attrs.read and cc.attrs.x =='t'}" style='width: #{cc.attrs.w}; font-weight: bold'><f:convertDateTime pattern='#{cc.attrs.pattern} HH:mm'/></h:outputText>

  </h:panelGroup>

</h:panelGrid>

</cc:implementation>

</html>